import request from '@/utils/request'

export default {
  addCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/edu-course/addCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  getCourseInfo(id) {
    return request({
      url: `/eduservice/edu-course/getCourseInfo/${id}`,
      method: 'get',
    })
  },
  updateCourseInfo(courseInfo) {
    return request({
      url: `/eduservice/edu-course/updateCourseInfo`,
      method: 'post',
      data: courseInfo
    })
  },
  // 课程确认信息
  getPublishCourseInfo(id) {
    return request({
      url: `/eduservice/edu-course/getPublishCourseInfo/${id}`,
      method: 'get',
    })
  },
  publishCourse(id) {
    return request({
      url: `/eduservice/edu-course/publishCourse/${id}`,
      method: 'post',
    })
  },

  getPageList(page, limit, searchObj) {
    return request({
      url: `/eduservice/edu-course/${page}/${limit}`,
      method: 'get',
      params: searchObj
    })
  },
  removeById(id) {
    return request({
      url: `/eduservice/edu-course/${id}`,
      method: 'delete'
    })
  }

}